CREATE TABLE [agency].[AgentBalanceDetail]
(
[AgentBalanceDetailId] [int] NOT NULL IDENTITY(1, 1),
[AgentId] [int] NULL,
[Balance] [decimal] (18, 0) NULL,
[UsageTypeId] [int] NULL,
[ItineraryId] [int] NULL,
[Active] [bit] NOT NULL,
[Deleted] [bit] NOT NULL,
[CreatedBy] [int] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [int] NULL,
[ModifiedOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [agency].[AgentBalanceDetail] ADD CONSTRAINT [PK_AgentBalanceDetail] PRIMARY KEY CLUSTERED  ([AgentBalanceDetailId]) ON [PRIMARY]
GO
ALTER TABLE [agency].[AgentBalanceDetail] ADD CONSTRAINT [FK_AgentBalanceDetail_Agent] FOREIGN KEY ([AgentId]) REFERENCES [agency].[Agent] ([AgentId])
GO
ALTER TABLE [agency].[AgentBalanceDetail] ADD CONSTRAINT [FK_AgentBalanceDetail_Itinerary] FOREIGN KEY ([ItineraryId]) REFERENCES [booking].[Itinerary] ([ItineraryId])
GO
